package com.isoft.service.flightUpdate.impl;

import com.isoft.dao.flightUpdate.FlightVoDao;
import com.isoft.entity.flightUpdate.FlightUpdateVo;
import com.isoft.service.flightUpdate.FlightVoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LiuGaoMing
 * @version 1.0
 * @description:
 * @date 2024/7/1 10:46
 */
@Service
public class FlightVoServiceImpl implements FlightVoService {

    @Autowired
    private FlightVoDao flightVoDao;
    @Override
    public List<FlightUpdateVo> getFlightAllVoPaged(int currentPage, int pageSize) {
        int offset = (currentPage - 1) * pageSize;
        return flightVoDao.getFlightAllVoPaged(offset, pageSize);
    }

    @Override
    public Long getTotalFlightRecords() {
        return flightVoDao.getTotalFlightRecords();
    }

    @Override
    public List<FlightUpdateVo> getFlightVoByNAPCDsPaged(
            String NAPCD1, String NAPCD2, String NAPCD3, int currentPage, int pageSize) {
        int offset = (currentPage - 1) * pageSize;
        return flightVoDao.getFlightVoByNAPCDsPaged(NAPCD1, NAPCD2, NAPCD3, offset, pageSize);
    }

    @Override
    public Long getTotalFlightRecordsByNAPCDs(String NAPCD1, String NAPCD2, String NAPCD3) {
        return flightVoDao.getTotalFlightRecordsByNAPCDs(NAPCD1, NAPCD2, NAPCD3);
    }
}
